***** Open Dataset: "Food Aid Shocks and Food Insecurity, Gamso 2024"

encode CountryName, gen (country1)
xtset country1 Year

// Statistical Models

** Table 1 (main model): 
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.e_polity2_lag1 , fe robust cluster( country1 )
outreg2 using myreg.doc, replace ctitle(Model 1)
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.e_polity2_lag1 i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model 2)
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model 3)
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model 4)

** Figure 1 (Marginal Effects Plot):
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1, fe robust cluster( country1 )
margins FoodAIDshockOECD_lag1, dydx( e_polity2_lag1 )
margins, at( FoodAIDshockOECD_lag1 =(0 1) e_polity2_lag1 =(-10(1)10)) vsquish 
margins, dydx( FoodAIDshockOECD_lag1 ) at( e_polity2_lag1 =(-10(1)10)) vsquish 
marginsplot, yline(0) addplot(hist e_polity2_lag1, yaxis(2) yscale(alt))


// Appendix:

** Table 3 (descriptive stats):
sum Prevalenceofundernourishment  FoodAIDshockOECD_lag1  e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1 AveUSEUgdpGrowth_lag1 EUPresidentColony_lag1 VoteagreementtoUS_lag1  FoodProductionIndex_lag1 Democ_Boix_lag1 v2x_polyarchy1 v2x_libdem1 v2x_partipdem1 v2x_delibdem1 v2x_egaldem1 FoodAIDshockOECD20_lag1 FoodAIDshockOECD25_lag1 FoodAIDshockOECD30_lag1

** Table 4 (More control variables):
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1 AveUSEUgdpGrowth_lag1 EUPresidentColony_lag1 VoteagreementtoUS_lag1  FoodProductionIndex_lag1, fe robust cluster( country1 )
outreg2 using myreg.doc, replace ctitle(Model A1)
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1 AveUSEUgdpGrowth_lag1 EUPresidentColony_lag1 VoteagreementtoUS_lag1  FoodProductionIndex_lag1 i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A2)

** Table 5 (Endogeneity - Arellano–Bond estimator):
gen Interaction1 = FoodAIDshockOECD_lag1*e_polity2_lag1

xi: xtabond Prevalenceofundernourishment v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  ,  endog( FoodAIDshockOECD_lag1 e_polity2_lag1 Interaction1) lag(1) vce(robust)
outreg2 using myreg.doc, replace ctitle(Model A3)
xi: xtabond Prevalenceofundernourishment v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1 AveUSEUgdpGrowth_lag1 EUPresidentColony_lag1 VoteagreementtoUS_lag1  FoodProductionIndex_lag1 ,  endog( FoodAIDshockOECD_lag1 e_polity2_lag1 Interaction1) lag(1) vce(robust)
outreg2 using myreg.doc, append ctitle(Model A4)

** Table 6 (Alternative democracy measure w/out year fe):

xtreg Prevalenceofundernourishment c.FoodAIDshockOECD_lag1##c.Democ_Boix_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1, fe robust cluster( country1 )
outreg2 using myreg.doc, replace ctitle(Model A5)
xtreg Prevalenceofundernourishment c.FoodAIDshockOECD_lag1##c.v2x_polyarchy1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A6)
xtreg Prevalenceofundernourishment c.FoodAIDshockOECD_lag1##c.v2x_libdem1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A7)
xtreg Prevalenceofundernourishment c.FoodAIDshockOECD_lag1##c.v2x_partipdem1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A8)
xtreg Prevalenceofundernourishment c.FoodAIDshockOECD_lag1##c.v2x_delibdem1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A9)
xtreg Prevalenceofundernourishment c.FoodAIDshockOECD_lag1##c.v2x_egaldem1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A10)

** Table 7 (Alternative democracy measure w/ year fe):

xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.Democ_Boix_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, replace ctitle(Model A11)
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.v2x_polyarchy1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A12)
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.v2x_libdem1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A13)
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.v2x_partipdem1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A14)
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.v2x_delibdem1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A15)
xtreg Prevalenceofundernourishment FoodAIDshockOECD_lag1##c.v2x_egaldem1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A16)

** Table 8 (Alternative aid shock measure w/out year fe):

xtreg Prevalenceofundernourishment FoodAIDshockOECD20_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  , fe robust cluster( country1 )
outreg2 using myreg.doc, replace ctitle(Model A17)
xtreg Prevalenceofundernourishment FoodAIDshockOECD25_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  , fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A17)
xtreg Prevalenceofundernourishment FoodAIDshockOECD30_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  , fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A19)

** Table 9 (Alternative aid shock measure w/ year fe):
xtreg Prevalenceofundernourishment FoodAIDshockOECD20_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, replace ctitle(Model A20)
xtreg Prevalenceofundernourishment FoodAIDshockOECD25_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A21)
xtreg Prevalenceofundernourishment FoodAIDshockOECD30_lag1##c.e_polity2_lag1 v2mecenefm_lag1 logGDPpc_lag1 downturn_lag1 Populationdensitypeoplepers_lag1 HighIntensityConflict_PRIO_lag1 e_pt_coup_lag1 Totalnumberofpeopleaffected_lag1  otherAIDgdpOECD_lag1  i.Year, fe robust cluster( country1 )
outreg2 using myreg.doc, append ctitle(Model A22)

